package ro.ubbcluj.cs.bs.backend.repository;

import ro.ubbcluj.cs.bs.backend.model.AbstractModel;
import ro.ubbcluj.cs.bs.backend.repository.exception.BiblioSpringRepositoryException;

import javax.ejb.Local;
import java.util.List;

@Local
public interface BaseRepository<T extends AbstractModel, I> {
    List<T> getAll() throws BiblioSpringRepositoryException;

    T getById(I id) throws BiblioSpringRepositoryException;

    T save(T item) throws BiblioSpringRepositoryException;

    T merge(T item) throws BiblioSpringRepositoryException;

    void delete(T item) throws BiblioSpringRepositoryException;
}
